﻿#define _CRT_SECURE_NO_WARNINGS 1
ORG 0000H
MOV R0, #21H
MOV R1, #05H
CLR A
LOOP : ADD A, @R0
INC R0
DJNZ R1, LOOP
MOV DPTR, #2000H
MOVX @DPTR, A
SJMP $
END



START:
MOV R0, #30H
MOV R2, #33

LOOP:
MOV A, @R0
CJNE A, #0AAH, NEXT
MOV 51H, #01H
SJMP, EXIT

NEXT :
INC R0
DJNZ R2, LOOP
MOV 51H, #00H

EXIT :
SJMP $
END



MOV R0, #00H
MOV R1, #20H
MOV R2, #33

LOOP:
MOV A, @R1
CJNE A, #00H, NEXT
INC R0

NEXT :
INC R1
DJNZ R2, LOOP

MOV 41H, R0
END



MOV TMOD, 01H     //·½Ê½1
LOOP : MOV TH1, #FEH
MOV TL1, #OCH
SETB TR0          //´ò¿ªtcon

LOOP1 : JNB TF0, LOOP1    //Îª1¼ÌÐøÖ´ÐÐ
CLR TF0  	     //°ÑËüÇåÁã
CPL P1.0
SJMP LOOP
END


ORG 0000H
MOV R0, #30H
MOV R2, #33         #21H ?

LOOP :
	MOV A, @R0
	CJNE A, #0AAH, NEXT
	MOV 51H, #01H
	SJMP EXIT

	NEXT :
INC R0
DJNZ R2, LOOP
MOV 51H, #00H

EXIT :
SJMP $
END



MOV TMOD #01H
LOOP :
MOV TH0, #FEH
MOV TL0, #0CH
SETB TR0

LOOP1 :
JNB TF0, LOOP1
CLR TF0
CPL P1.0
SJMP LOOP

END




MOV R0, #40H
MOV R2, #33

LOOP:
MOV A, @R0
CJNE A, #0DAH, LOOP1
MOV 51H, #00H
SJMP NEXT

LOOP1 :
INC R0
DJNZ R2, LOOP
MOV 51H, #01H

NEXT :
SJMP $
END

MOV TMOD, #01H
LOOP :
MOV TH0, #0FEH
MOV TL0, #0CH
SETB TR0

LOOP1 :
JNB TF0, LOOP1
CLR TF0
CPL P1.0
SJMP LOOP
END



ORG 0100H
MOV A #82H
MOV DPTR, #FF7FH
MOVX @DPTR, A
MOV DPTR, #FF7DH
MOVX A, @DPTR
MOV DPTR, #FF7CH
MOVX @DPTR, A
END